.class public abstract Lcom/nemustech/tiffany/world/TFSimpleHolder;
.super Lcom/nemustech/tiffany/world/TFHolder;
.source "TFSimpleHolder.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;,
        Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;
    }
.end annotation


# static fields
.field private static final TAG:Ljava/lang/String; = "TFSimpleHolder"


# instance fields
.field protected mFadingEffect:Z

.field private mOnMoveListener:Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 10
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFHolder;-><init>()V

    .line 11
    new-instance v0, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;

    invoke-direct {v0, p0, p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;-><init>(Lcom/nemustech/tiffany/world/TFSimpleHolder;Lcom/nemustech/tiffany/world/TFSimpleHolder;)V

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .line 12
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mFadingEffect:Z

    .line 13
    return-void
.end method

.method public constructor <init>(Z)V
    .locals 1
    .parameter "isTerminalHolder"

    .prologue
    .line 16
    invoke-direct {p0, p1}, Lcom/nemustech/tiffany/world/TFHolder;-><init>(Z)V

    .line 17
    new-instance v0, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;

    invoke-direct {v0, p0, p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;-><init>(Lcom/nemustech/tiffany/world/TFSimpleHolder;Lcom/nemustech/tiffany/world/TFSimpleHolder;)V

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .line 18
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mFadingEffect:Z

    .line 19
    return-void
.end method

.method private applyFadingEffect(Lcom/nemustech/tiffany/world/TFObject;I)V
    .locals 5
    .parameter "object"
    .parameter "slotIdx"

    .prologue
    const/high16 v4, 0x3f00

    const/4 v3, 0x0

    const/high16 v2, 0x3f80

    .line 57
    if-nez p2, :cond_0

    iget v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    cmpl-float v0, v0, v3

    if-ltz v0, :cond_0

    .line 58
    iget v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    div-float/2addr v0, v4

    sub-float v0, v2, v0

    iput v0, p1, Lcom/nemustech/tiffany/world/TFObject;->mExternalFadingFactor:F

    .line 71
    :goto_0
    return-void

    .line 60
    :cond_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v0

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    if-ne p2, v0, :cond_1

    iget v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    cmpg-float v0, v0, v3

    if-gtz v0, :cond_1

    .line 61
    iget v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    div-float/2addr v0, v4

    add-float/2addr v0, v2

    iput v0, p1, Lcom/nemustech/tiffany/world/TFObject;->mExternalFadingFactor:F

    goto :goto_0

    .line 64
    :cond_1
    instance-of v0, p1, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v0, :cond_2

    .line 65
    iput v2, p1, Lcom/nemustech/tiffany/world/TFObject;->mExternalFadingFactor:F

    goto :goto_0

    .line 68
    :cond_2
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFObject;->getOpacity()F

    move-result v0

    iput v0, p1, Lcom/nemustech/tiffany/world/TFObject;->mExternalFadingFactor:F

    goto :goto_0
.end method

.method private handlePartialEndlessLoop()V
    .locals 6

    .prologue
    .line 534
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v4

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-ge v4, v5, :cond_2

    iget-boolean v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWraparound:Z

    if-eqz v4, :cond_2

    .line 535
    const/4 v0, 0x0

    .line 536
    .local v0, curSlotIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v4

    invoke-virtual {p0, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v3

    .line 537
    .local v3, virtualHeadSlot:I
    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v4}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_2

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 538
    .local v2, referenceWrapper:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v4

    sub-int/2addr v4, v3

    if-lt v0, v4, :cond_0

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v4

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v5

    add-int/2addr v4, v5

    sub-int/2addr v4, v3

    if-gt v4, v0, :cond_1

    .line 539
    :cond_0
    const/4 v4, -0x1

    invoke-virtual {p0, v2, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 544
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 542
    :cond_1
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v4

    sub-int/2addr v4, v3

    sub-int v4, v0, v4

    invoke-virtual {p0, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->calculateItemIndexOfSlot(I)I

    move-result v4

    invoke-virtual {p0, v2, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    goto :goto_1

    .line 547
    .end local v0           #curSlotIndex:I
    .end local v1           #i$:Ljava/util/Iterator;
    .end local v2           #referenceWrapper:Lcom/nemustech/tiffany/world/TFObjectContainer;
    .end local v3           #virtualHeadSlot:I
    :cond_2
    return-void
.end method


# virtual methods
.method addHolder(Lcom/nemustech/tiffany/world/TFHolder;)Z
    .locals 1
    .parameter "holder"

    .prologue
    .line 204
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->addHolder(Lcom/nemustech/tiffany/world/TFHolder;I)Z

    move-result v0

    return v0
.end method

.method addHolder(Lcom/nemustech/tiffany/world/TFHolder;I)Z
    .locals 11
    .parameter "holder"
    .parameter "slotIndex"

    .prologue
    const/4 v10, 0x0

    const/4 v9, 0x1

    .line 208
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->isTerminalHolder()Z

    move-result v7

    if-eqz v7, :cond_0

    .line 209
    new-instance v7, Ljava/lang/IllegalArgumentException;

    const-string v8, "Tried to attach a holder to terminal holder"

    invoke-direct {v7, v8}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v7

    .line 210
    :cond_0
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    if-le p2, v7, :cond_1

    .line 211
    new-instance v7, Ljava/lang/IllegalArgumentException;

    const-string v8, "The given slot index exceeds slot count"

    invoke-direct {v7, v8}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v7

    .line 214
    :cond_1
    iput-object p0, p1, Lcom/nemustech/tiffany/world/TFHolder;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    .line 215
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {p1, v7}, Lcom/nemustech/tiffany/world/TFHolder;->associateToWorld(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 217
    new-instance v5, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-direct {v5, p1}, Lcom/nemustech/tiffany/world/TFObjectContainer;-><init>(Lcom/nemustech/tiffany/world/TFObject;)V

    .line 218
    .local v5, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v7, :cond_5

    .line 220
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v7

    if-eqz v7, :cond_4

    .line 221
    iget v6, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 222
    .local v6, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v7

    iget v8, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v7, v8

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 223
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, p2, v5}, Ljava/util/LinkedList;->add(ILjava/lang/Object;)V

    .line 225
    const/4 v3, 0x0

    .line 226
    .local v3, idx:I
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 227
    .local v0, container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v7

    invoke-virtual {v7, v3}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 228
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 231
    .end local v0           #container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_2
    if-lt v6, p2, :cond_3

    .line 232
    add-int/lit8 v6, v6, 0x1

    .line 234
    :cond_3
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 235
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 236
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->indexOf(Ljava/lang/Object;)I

    move-result v7

    invoke-virtual {p0, p1, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 237
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v7

    sub-int v7, v6, v7

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 238
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadItemIndex()I

    move-result v7

    iput v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 258
    .end local v2           #i$:Ljava/util/Iterator;
    .end local v3           #idx:I
    .end local v6           #originalHeadItemIndex:I
    :goto_1
    iget v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadItemIndex(IZ)V

    .line 264
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v7, :cond_6

    .line 265
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .restart local v2       #i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_6

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/nemustech/tiffany/world/TFObject;

    .line 267
    .local v4, o:Lcom/nemustech/tiffany/world/TFObject;
    :try_start_0
    check-cast v4, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v4           #o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFHolder;->clone()Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/nemustech/tiffany/world/TFHolder;

    invoke-virtual {v4, v7, p2}, Lcom/nemustech/tiffany/world/TFHolder;->addHolder(Lcom/nemustech/tiffany/world/TFHolder;I)Z
    :try_end_0
    .catch Ljava/lang/CloneNotSupportedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    .line 268
    :catch_0
    move-exception v7

    move-object v1, v7

    .line 270
    .local v1, e:Ljava/lang/CloneNotSupportedException;
    invoke-virtual {v1}, Ljava/lang/CloneNotSupportedException;->printStackTrace()V

    goto :goto_2

    .line 241
    .end local v1           #e:Ljava/lang/CloneNotSupportedException;
    .end local v2           #i$:Ljava/util/Iterator;
    :cond_4
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 242
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v10}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {p0, v7, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 243
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 244
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 245
    invoke-virtual {p0, p1, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 246
    iput v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    goto :goto_1

    .line 250
    :cond_5
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v5}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 251
    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    .line 252
    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mSetItemNow:Z

    .line 253
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 254
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v7

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 255
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 256
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v7

    sub-int/2addr v7, v9

    invoke-virtual {p0, p1, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto/16 :goto_1

    .line 275
    :cond_6
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v7, :cond_7

    .line 276
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 278
    :cond_7
    return v9
.end method

.method addModel(Lcom/nemustech/tiffany/world/TFModel;)Z
    .locals 1
    .parameter "model"

    .prologue
    .line 340
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->addModel(Lcom/nemustech/tiffany/world/TFModel;I)Z

    move-result v0

    return v0
.end method

.method addModel(Lcom/nemustech/tiffany/world/TFModel;I)Z
    .locals 13
    .parameter "model"
    .parameter "slotIndex"

    .prologue
    const/4 v12, 0x1

    .line 344
    const-class v10, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v10

    .line 345
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->isTerminalHolder()Z

    move-result v9

    if-nez v9, :cond_0

    .line 346
    new-instance v9, Ljava/lang/IllegalArgumentException;

    const-string v11, "Cannot attach a model to non terminal holder"

    invoke-direct {v9, v11}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v9

    .line 414
    :catchall_0
    move-exception v9

    monitor-exit v10
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v9

    .line 347
    :cond_0
    :try_start_1
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    if-le p2, v9, :cond_1

    .line 348
    new-instance v9, Ljava/lang/IllegalArgumentException;

    const-string v11, "Invalid slotIndex"

    invoke-direct {v9, v11}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v9

    .line 350
    :cond_1
    iput-object p0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    .line 351
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iput-object v9, p1, Lcom/nemustech/tiffany/world/TFModel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 353
    new-instance v7, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-direct {v7, p1}, Lcom/nemustech/tiffany/world/TFObjectContainer;-><init>(Lcom/nemustech/tiffany/world/TFObject;)V

    .line 354
    .local v7, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v9, :cond_5

    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v9, :cond_5

    .line 356
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v9

    if-eqz v9, :cond_4

    .line 357
    iget v8, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 358
    .local v8, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v9

    iget v11, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v9, v11

    const/4 v11, 0x0

    invoke-virtual {p0, v9, v11}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 359
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, p2, v7}, Ljava/util/LinkedList;->add(ILjava/lang/Object;)V

    .line 361
    const/4 v5, 0x0

    .line 362
    .local v5, idx:I
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .local v4, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-eqz v9, :cond_2

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 363
    .local v1, container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {v1}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v9

    invoke-virtual {v9, v5}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 364
    add-int/lit8 v5, v5, 0x1

    goto :goto_0

    .line 367
    .end local v1           #container:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_2
    if-lt v8, p2, :cond_3

    .line 368
    add-int/lit8 v8, v8, 0x1

    .line 370
    :cond_3
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 371
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v12

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 372
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 373
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v9

    sub-int v9, v8, v9

    const/4 v11, 0x0

    invoke-virtual {p0, v9, v11}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 374
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadItemIndex()I

    move-result v9

    iput v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 394
    .end local v4           #i$:Ljava/util/Iterator;
    .end local v5           #idx:I
    .end local v8           #originalHeadItemIndex:I
    :goto_1
    iget v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    const/4 v11, 0x0

    invoke-virtual {p0, v9, v11}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadItemIndex(IZ)V

    .line 400
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v9, :cond_6

    .line 401
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    .restart local v4       #i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v9

    if-eqz v9, :cond_6

    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/nemustech/tiffany/world/TFObject;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 403
    .local v6, o:Lcom/nemustech/tiffany/world/TFObject;
    :try_start_2
    move-object v0, v6

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v3, v0

    .line 404
    .local v3, h:Lcom/nemustech/tiffany/world/TFHolder;
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->clone()Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/nemustech/tiffany/world/TFModel;

    invoke-virtual {v3, v9, p2}, Lcom/nemustech/tiffany/world/TFHolder;->addModel(Lcom/nemustech/tiffany/world/TFModel;I)Z
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/CloneNotSupportedException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2

    .line 405
    .end local v3           #h:Lcom/nemustech/tiffany/world/TFHolder;
    :catch_0
    move-exception v9

    move-object v2, v9

    .line 407
    .local v2, e:Ljava/lang/CloneNotSupportedException;
    :try_start_3
    invoke-virtual {v2}, Ljava/lang/CloneNotSupportedException;->printStackTrace()V

    goto :goto_2

    .line 377
    .end local v2           #e:Ljava/lang/CloneNotSupportedException;
    .end local v4           #i$:Ljava/util/Iterator;
    .end local v6           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_4
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, v7}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 378
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    const/4 v11, 0x0

    invoke-virtual {v9, v11}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Lcom/nemustech/tiffany/world/TFObjectContainer;

    const/4 v11, 0x0

    invoke-virtual {p0, v9, v11}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 379
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 380
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v12

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 381
    const/4 v9, 0x0

    invoke-virtual {p0, p1, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 382
    const/4 v9, 0x0

    iput v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    goto :goto_1

    .line 386
    :cond_5
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9, v7}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 387
    const/4 v9, 0x1

    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    .line 388
    const/4 v9, 0x1

    iput-boolean v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mSetItemNow:Z

    .line 389
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v12

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->calculateItemIndexOfSlot(I)I

    move-result v9

    invoke-virtual {p0, v7, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 390
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v9

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 391
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v12

    invoke-virtual {p0, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 392
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v9}, Ljava/util/LinkedList;->size()I

    move-result v9

    sub-int/2addr v9, v12

    invoke-virtual {p0, p1, v9}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onAddModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    goto/16 :goto_1

    .line 412
    :cond_6
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->refreshHolder()V

    .line 413
    monitor-exit v10
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    return v12
.end method

.method addModel(Lcom/nemustech/tiffany/world/TFModel;IZ)Z
    .locals 1
    .parameter "model"
    .parameter "slotIndex"
    .parameter "showAnimation"

    .prologue
    .line 418
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->addModel(Lcom/nemustech/tiffany/world/TFModel;)Z

    move-result v0

    return v0
.end method

.method public clone()Ljava/lang/Object;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/CloneNotSupportedException;
        }
    .end annotation

    .prologue
    .line 22
    invoke-super {p0}, Lcom/nemustech/tiffany/world/TFHolder;->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/nemustech/tiffany/world/TFSimpleHolder;

    .line 23
    .local v0, clone:Lcom/nemustech/tiffany/world/TFSimpleHolder;
    new-instance v1, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;

    invoke-direct {v1, p0, v0}, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;-><init>(Lcom/nemustech/tiffany/world/TFSimpleHolder;Lcom/nemustech/tiffany/world/TFSimpleHolder;)V

    iput-object v1, v0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .line 24
    return-object v0
.end method

.method protected abstract getModelPosition(I)F
.end method

.method public bridge synthetic getMoveAnimation()Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;
    .locals 1

    .prologue
    .line 7
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getMoveAnimation()Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;

    move-result-object v0

    return-object v0
.end method

.method public getMoveAnimation()Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;
    .locals 2

    .prologue
    .line 796
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 797
    :try_start_0
    iget-object p0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFSimpleHolder$SimpleMoveAnimation;

    monitor-exit v0

    return-object p0

    .line 798
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public getObjectInSlot(I)Lcom/nemustech/tiffany/world/TFObject;
    .locals 5
    .parameter "idx"

    .prologue
    .line 158
    const-class v3, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v3

    .line 159
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v2

    if-ge p1, v2, :cond_1

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v2

    if-eqz v2, :cond_1

    .line 160
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v2, :cond_0

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v2, :cond_0

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v2

    if-ltz v2, :cond_0

    .line 161
    iget v1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 162
    .local v1, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v2

    iget v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v2, v4

    const/4 v4, 0x0

    invoke-virtual {p0, v2, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 164
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v2, p1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v2}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v0

    .line 166
    .local v0, object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v2

    sub-int v2, v1, v2

    const/4 v4, 0x0

    invoke-virtual {p0, v2, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 167
    monitor-exit v3

    move-object v2, v0

    .line 174
    .end local v0           #object:Lcom/nemustech/tiffany/world/TFObject;
    .end local v1           #originalHeadItemIndex:I
    .end local p0
    :goto_0
    return-object v2

    .line 170
    .restart local p0
    :cond_0
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v2, p1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v2

    monitor-exit v3

    goto :goto_0

    .line 176
    :catchall_0
    move-exception v2

    monitor-exit v3
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2

    .line 174
    .restart local p0
    :cond_1
    const/4 v2, 0x0

    :try_start_1
    monitor-exit v3
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0
.end method

.method public getOnMoveListener()Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;
    .locals 2

    .prologue
    .line 677
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 678
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnMoveListener:Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;

    monitor-exit v0

    return-object v1

    .line 679
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public getSlotIndex(Lcom/nemustech/tiffany/world/TFObject;)I
    .locals 5
    .parameter "object"

    .prologue
    .line 187
    const-class v2, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v2

    .line 188
    :try_start_0
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v3, :cond_0

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v3, :cond_0

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v3

    if-ltz v3, :cond_0

    .line 189
    iget v1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 190
    .local v1, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v3

    iget v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v3, v4

    const/4 v4, 0x0

    invoke-virtual {p0, v3, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 192
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFObject;->getWrapperObject()Lcom/nemustech/tiffany/world/TFObjectContainer;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/LinkedList;->indexOf(Ljava/lang/Object;)I

    move-result v0

    .line 194
    .local v0, idx:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v3

    sub-int v3, v1, v3

    const/4 v4, 0x0

    invoke-virtual {p0, v3, v4}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 195
    monitor-exit v2

    move v2, v0

    .line 198
    .end local v0           #idx:I
    .end local v1           #originalHeadItemIndex:I
    :goto_0
    return v2

    :cond_0
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFObject;->getWrapperObject()Lcom/nemustech/tiffany/world/TFObjectContainer;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/util/LinkedList;->indexOf(Ljava/lang/Object;)I

    move-result v3

    monitor-exit v2

    move v2, v3

    goto :goto_0

    .line 200
    :catchall_0
    move-exception v3

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v3
.end method

.method public layoutObjects(F)V
    .locals 11
    .parameter "headDeviation"

    .prologue
    const/high16 v10, 0x3f80

    .line 561
    const-class v8, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v8

    .line 562
    :try_start_0
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7}, Ljava/util/LinkedList;->size()I

    move-result v0

    .line 565
    .local v0, count:I
    float-to-int v7, p1

    int-to-float v7, v7

    sub-float v6, p1, v7

    .line 570
    .local v6, t:F
    const/4 v7, 0x0

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelPosition(I)F

    move-result v4

    .line 571
    .local v4, p1:F
    const/4 v7, -0x1

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelPosition(I)F

    move-result v5

    .line 573
    .local v5, p2:F
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-ge v1, v0, :cond_2

    .line 574
    const/4 v7, 0x0

    cmpg-float v7, v6, v7

    if-gez v7, :cond_1

    .line 576
    add-int/lit8 v7, v1, 0x1

    invoke-virtual {p0, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelPosition(I)F

    move-result v5

    .line 577
    neg-float v7, v6

    sub-float v7, v10, v7

    mul-float/2addr v7, v4

    neg-float v9, v6

    mul-float/2addr v9, v5

    add-float v3, v7, v9

    .line 578
    .local v3, p:F
    move v4, v5

    .line 586
    :goto_1
    iget-object v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v7, v1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v7}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v2

    .line 587
    .local v2, o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {p0, v2, v3, v1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->locateObject(Lcom/nemustech/tiffany/world/TFObject;FI)V

    .line 588
    iget-boolean v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mFadingEffect:Z

    if-eqz v7, :cond_0

    .line 589
    invoke-direct {p0, v2, v1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->applyFadingEffect(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 573
    :cond_0
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 582
    .end local v2           #o:Lcom/nemustech/tiffany/world/TFObject;
    .end local v3           #p:F
    :cond_1
    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelPosition(I)F

    move-result v4

    .line 583
    sub-float v7, v10, v6

    mul-float/2addr v7, v4

    mul-float v9, v6, v5

    add-float v3, v7, v9

    .line 584
    .restart local v3       #p:F
    move v5, v4

    goto :goto_1

    .line 591
    .end local v3           #p:F
    :cond_2
    monitor-exit v8

    .line 592
    return-void

    .line 591
    .end local v0           #count:I
    .end local v1           #i:I
    .end local v4           #p1:F
    .end local v5           #p2:F
    .end local v6           #t:F
    :catchall_0
    move-exception v7

    monitor-exit v8
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v7
.end method

.method protected abstract locateObject(Lcom/nemustech/tiffany/world/TFObject;FI)V
.end method

.method public moveHeadModelStep(FZ)Z
    .locals 12
    .parameter "step"
    .parameter "bindingAction"

    .prologue
    .line 724
    const-class v9, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v9

    .line 725
    :try_start_0
    iget v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    add-float v3, p1, v10

    .line 726
    .local v3, nextStep:F
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getDeviation()F

    move-result v7

    .line 729
    .local v7, prevDeviation:F
    iget v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    .line 730
    .local v5, oldHeadDeviation:F
    iget v6, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 733
    .local v6, oldHeadItemIndex:I
    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getDeviation(F)F

    move-result v0

    .line 734
    .local v0, deviation:F
    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getOffset(F)I

    move-result v4

    .line 737
    .local v4, offset:I
    const/4 v10, 0x1

    invoke-virtual {p0, v4, v10}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->scrollHeadItemIndex(IZ)I

    move-result v2

    .line 738
    .local v2, moved:I
    if-ne v2, v4, :cond_7

    .line 740
    iput v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    .line 747
    :goto_0
    iget-boolean v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDelayedSetItemMode:Z

    if-eqz v10, :cond_3

    iget v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    mul-float/2addr v10, v5

    const/4 v11, 0x0

    cmpg-float v10, v10, v11

    if-lez v10, :cond_0

    invoke-static {p1}, Ljava/lang/Math;->abs(F)F

    move-result v10

    const/high16 v11, 0x3f00

    cmpl-float v10, v10, v11

    if-lez v10, :cond_3

    .line 748
    :cond_0
    const/4 v1, 0x0

    .line 750
    .local v1, isShifted:Z
    iget v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    if-eq v6, v10, :cond_1

    .line 751
    const/4 v1, 0x1

    .line 754
    :cond_1
    iget-boolean v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    if-eqz v10, :cond_3

    if-eqz v1, :cond_2

    invoke-static {p1}, Ljava/lang/Math;->abs(F)F

    move-result v10

    const/high16 v11, 0x3f00

    cmpl-float v10, v10, v11

    if-lez v10, :cond_3

    .line 755
    :cond_2
    const/4 v10, 0x1

    iput-boolean v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mSetItemNow:Z

    .line 756
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->refreshSlotIndex()V

    .line 761
    .end local v1           #isShifted:Z
    :cond_3
    iget v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    cmpl-float v10, v7, v10

    if-eqz v10, :cond_4

    .line 762
    const/4 v10, 0x1

    iput-boolean v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mLayoutObjects:Z

    .line 763
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v10, :cond_4

    .line 764
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 768
    :cond_4
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHolderBindings:Ljava/util/LinkedList;

    invoke-virtual {v10}, Ljava/util/LinkedList;->isEmpty()Z

    move-result v10

    if-nez v10, :cond_5

    if-eqz p2, :cond_5

    .line 769
    move v8, p1

    .line 770
    .local v8, theStep:F
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mBindingBehaviorDispatcher:Lcom/nemustech/tiffany/world/TFHolder$BindingBehaviorDispatcher;

    if-eqz v10, :cond_8

    .line 771
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    new-instance v10, Lcom/nemustech/tiffany/world/TFSimpleHolder$1;

    invoke-direct {v10, p0, v8}, Lcom/nemustech/tiffany/world/TFSimpleHolder$1;-><init>(Lcom/nemustech/tiffany/world/TFSimpleHolder;F)V

    invoke-static {v10}, Lcom/nemustech/tiffany/world/TFWorld;->queueEvent(Ljava/lang/Runnable;)V

    .line 786
    .end local v8           #theStep:F
    :cond_5
    :goto_1
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnMoveListener:Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;

    if-eqz v10, :cond_6

    .line 787
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnMoveListener:Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;

    invoke-interface {v10, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;->onMove(F)V

    .line 791
    :cond_6
    if-ne v4, v2, :cond_9

    const/4 v10, 0x1

    :goto_2
    monitor-exit v9

    return v10

    .line 743
    :cond_7
    const v10, 0x3ee66666

    mul-float/2addr v10, v3

    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v11

    div-float/2addr v10, v11

    iput v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    goto :goto_0

    .line 792
    .end local v0           #deviation:F
    .end local v2           #moved:I
    .end local v3           #nextStep:F
    .end local v4           #offset:I
    .end local v5           #oldHeadDeviation:F
    .end local v6           #oldHeadItemIndex:I
    .end local v7           #prevDeviation:F
    :catchall_0
    move-exception v10

    monitor-exit v9
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v10

    .line 778
    .restart local v0       #deviation:F
    .restart local v2       #moved:I
    .restart local v3       #nextStep:F
    .restart local v4       #offset:I
    .restart local v5       #oldHeadDeviation:F
    .restart local v6       #oldHeadItemIndex:I
    .restart local v7       #prevDeviation:F
    .restart local v8       #theStep:F
    :cond_8
    :try_start_1
    iget-object v10, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    new-instance v10, Lcom/nemustech/tiffany/world/TFSimpleHolder$2;

    invoke-direct {v10, p0, v8}, Lcom/nemustech/tiffany/world/TFSimpleHolder$2;-><init>(Lcom/nemustech/tiffany/world/TFSimpleHolder;F)V

    invoke-static {v10}, Lcom/nemustech/tiffany/world/TFWorld;->queueEvent(Ljava/lang/Runnable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    .line 791
    .end local v8           #theStep:F
    :cond_9
    const/4 v10, 0x0

    goto :goto_2
.end method

.method public printSlots(Ljava/lang/String;)V
    .locals 6
    .parameter "tag"

    .prologue
    .line 863
    const-class v4, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v4

    .line 864
    :try_start_0
    const-string v3, "-----------------------------------------------------------------------------------------"

    invoke-static {p1, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 865
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v3

    if-ge v0, v3, :cond_1

    .line 866
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v3, v0}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v3}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v2

    .line 867
    .local v2, object:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v2}, Lcom/nemustech/tiffany/world/TFObject;->getItemIndex()I

    move-result v1

    .line 868
    .local v1, itemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v3

    if-ne v0, v3, :cond_0

    .line 869
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "slot index: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v5, " item index is: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v5, " mDescription is: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v5, v2, Lcom/nemustech/tiffany/world/TFObject;->mDescription:Ljava/lang/String;

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v5, " <-- head"

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {p1, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 865
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 871
    :cond_0
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "slot index: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v5, " item index is: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v5, " mDescription is: "

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v5, v2, Lcom/nemustech/tiffany/world/TFObject;->mDescription:Ljava/lang/String;

    invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {p1, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1

    .line 873
    .end local v0           #i:I
    .end local v1           #itemIndex:I
    .end local v2           #object:Lcom/nemustech/tiffany/world/TFObject;
    :catchall_0
    move-exception v3

    monitor-exit v4
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v3

    .restart local v0       #i:I
    :cond_1
    :try_start_1
    monitor-exit v4
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 874
    return-void
.end method

.method removeHolder(I)Lcom/nemustech/tiffany/world/TFHolder;
    .locals 1
    .parameter "slotIndex"

    .prologue
    .line 282
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->removeHolder(IZ)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v0

    return-object v0
.end method

.method removeHolder(IZ)Lcom/nemustech/tiffany/world/TFHolder;
    .locals 8
    .parameter "slotIndex"
    .parameter "showAnimation"

    .prologue
    const/4 v7, 0x0

    .line 286
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->isTerminalHolder()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 287
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "This holder is a terminal holder which does not hold any holders but models"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 288
    :cond_0
    if-ltz p1, :cond_1

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->size()I

    move-result v5

    if-gt v5, p1, :cond_2

    .line 289
    :cond_1
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "Slot index out of bounds"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 290
    :cond_2
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    if-gez v5, :cond_3

    .line 291
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "Head Slot index has been set to an invalid index"

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 293
    :cond_3
    const/4 v0, 0x0

    .line 294
    .local v0, holder:Lcom/nemustech/tiffany/world/TFHolder;
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v5, :cond_7

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v5, :cond_7

    .line 296
    iget v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 297
    .local v4, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    iget v6, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v5, v6

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 298
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHolderInSlot(I)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v0

    .line 299
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 300
    move v1, p1

    .local v1, i:I
    :goto_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-ge v1, v5, :cond_4

    .line 301
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v5}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v5

    invoke-virtual {v5, v1}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 300
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 303
    :cond_4
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 304
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 305
    invoke-virtual {p0, v0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onRemoveHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 307
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-lez v5, :cond_6

    .line 308
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    if-lt v4, v5, :cond_5

    .line 309
    add-int/lit8 v4, v4, -0x1

    .line 311
    :cond_5
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    sub-int v5, v4, v5

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 329
    .end local v1           #i:I
    .end local v4           #originalHeadItemIndex:I
    :cond_6
    :goto_1
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v5, :cond_8

    .line 330
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    .local v2, i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_8

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/nemustech/tiffany/world/TFObject;

    .line 331
    .local v3, o:Lcom/nemustech/tiffany/world/TFObject;
    check-cast v3, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v3           #o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v3, p1}, Lcom/nemustech/tiffany/world/TFHolder;->removeHolder(I)Lcom/nemustech/tiffany/world/TFHolder;

    goto :goto_2

    .line 315
    .end local v2           #i$:Ljava/util/Iterator;
    :cond_7
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHolderInSlot(I)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v0

    .line 316
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 317
    invoke-virtual {p0, v0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onRemoveHolder(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 318
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 319
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    goto :goto_1

    .line 335
    :cond_8
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->requestLayout()V

    .line 336
    return-object v0
.end method

.method removeModel(I)Lcom/nemustech/tiffany/world/TFModel;
    .locals 1
    .parameter "slotIndex"

    .prologue
    .line 425
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->removeModel(IZ)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v0

    return-object v0
.end method

.method removeModel(IZ)Lcom/nemustech/tiffany/world/TFModel;
    .locals 8
    .parameter "slotIndex"
    .parameter "showAnimation"

    .prologue
    const/4 v7, 0x0

    .line 429
    const-class v6, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v6

    .line 430
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->isTerminalHolder()Z

    move-result v5

    if-nez v5, :cond_0

    .line 431
    monitor-exit v6

    move-object v5, v7

    .line 483
    :goto_0
    return-object v5

    .line 432
    :cond_0
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->size()I

    move-result v5

    if-lt p1, v5, :cond_1

    .line 433
    monitor-exit v6

    move-object v5, v7

    goto :goto_0

    .line 435
    :cond_1
    const/4 v2, 0x0

    .line 436
    .local v2, model:Lcom/nemustech/tiffany/world/TFModel;
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v5, :cond_7

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v5, :cond_7

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    if-ltz v5, :cond_7

    .line 438
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-eqz v5, :cond_6

    .line 439
    iget v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 440
    .local v4, originalHeadItemIndex:I
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    iget v7, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v5, v7

    const/4 v7, 0x0

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 441
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelInSlot(I)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v2

    .line 442
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 443
    move v0, p1

    .local v0, i:I
    :goto_1
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-ge v0, v5, :cond_2

    .line 444
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, v0}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lcom/nemustech/tiffany/world/TFObjectContainer;

    invoke-virtual {v5}, Lcom/nemustech/tiffany/world/TFObjectContainer;->getObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v5

    invoke-virtual {v5, v0}, Lcom/nemustech/tiffany/world/TFObject;->setItemIndex(I)V

    .line 443
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 446
    :cond_2
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-lez v5, :cond_3

    .line 447
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex(I)I

    move-result v5

    invoke-virtual {p0, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setHeadSlotIndex(I)V

    .line 449
    :cond_3
    invoke-virtual {p0, v2, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onRemoveModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 450
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    .line 451
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-lez v5, :cond_5

    .line 452
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    if-lt v4, v5, :cond_4

    .line 453
    add-int/lit8 v4, v4, -0x1

    .line 455
    :cond_4
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadSlotIndex()I

    move-result v5

    sub-int v5, v4, v5

    const/4 v7, 0x0

    invoke-virtual {p0, v5, v7}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsMultipleSlots(IZ)I

    .line 476
    .end local v0           #i:I
    .end local v4           #originalHeadItemIndex:I
    :cond_5
    :goto_2
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    if-eqz v5, :cond_8

    .line 477
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mCloneList:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_3
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_8

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/nemustech/tiffany/world/TFObject;

    .line 478
    .local v3, o:Lcom/nemustech/tiffany/world/TFObject;
    check-cast v3, Lcom/nemustech/tiffany/world/TFHolder;

    .end local v3           #o:Lcom/nemustech/tiffany/world/TFObject;
    invoke-virtual {v3, p1}, Lcom/nemustech/tiffany/world/TFHolder;->removeModel(I)Lcom/nemustech/tiffany/world/TFModel;

    goto :goto_3

    .line 484
    .end local v1           #i$:Ljava/util/Iterator;
    .end local v2           #model:Lcom/nemustech/tiffany/world/TFModel;
    :catchall_0
    move-exception v5

    monitor-exit v6
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v5

    .line 459
    .restart local v2       #model:Lcom/nemustech/tiffany/world/TFModel;
    :cond_6
    :try_start_1
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v7, "Nothing to remove"

    invoke-direct {v5, v7}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 463
    :cond_7
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getModelInSlot(I)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v2

    .line 464
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5, p1}, Ljava/util/LinkedList;->remove(I)Ljava/lang/Object;

    .line 465
    invoke-virtual {p0, v2, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->onRemoveModel(Lcom/nemustech/tiffany/world/TFObject;I)V

    .line 466
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setDrawOrder(I)V

    goto :goto_2

    .line 482
    :cond_8
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->requestLayout()V

    .line 483
    monitor-exit v6
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-object v5, v2

    goto/16 :goto_0
.end method

.method protected scrollHeadItemIndex(IZ)I
    .locals 6
    .parameter "offset"
    .parameter "callListener"

    .prologue
    const/4 v5, 0x1

    .line 685
    iget v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 686
    .local v0, headIndex:I
    add-int v2, v0, p1

    .line 688
    .local v2, newIndex:I
    if-eqz p1, :cond_0

    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDelayedSetItemMode:Z

    if-eqz v3, :cond_0

    .line 689
    iput-boolean v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    .line 692
    :cond_0
    if-gez p1, :cond_2

    .line 694
    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWraparound:Z

    if-nez v3, :cond_1

    if-gez v2, :cond_1

    .line 695
    neg-int p1, v0

    .line 696
    :cond_1
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    neg-int v3, p1

    if-ge v1, v3, :cond_4

    .line 697
    const/4 v3, -0x1

    invoke-virtual {p0, v3, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsSingleSlot(IZ)Z

    .line 696
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 702
    .end local v1           #i:I
    :cond_2
    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWraparound:Z

    if-nez v3, :cond_3

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v3

    if-gt v3, v2, :cond_3

    .line 703
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v3

    sub-int/2addr v3, v5

    iget v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int p1, v3, v4

    .line 704
    :cond_3
    const/4 v1, 0x0

    .restart local v1       #i:I
    :goto_1
    if-ge v1, p1, :cond_4

    .line 705
    invoke-virtual {p0, v5, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsSingleSlot(IZ)Z

    .line 704
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 709
    :cond_4
    if-lez p1, :cond_5

    .line 715
    iput-boolean v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mLayoutObjects:Z

    .line 716
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v3, :cond_5

    .line 717
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 720
    :cond_5
    return p1
.end method

.method public setDelayedSetItemMode(Z)V
    .locals 2
    .parameter "value"

    .prologue
    .line 488
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 489
    :try_start_0
    iput-boolean p1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDelayedSetItemMode:Z

    .line 490
    monitor-exit v0

    .line 491
    return-void

    .line 490
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public setFadingEffect(Z)V
    .locals 2
    .parameter "fadeEffect"

    .prologue
    .line 51
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 52
    :try_start_0
    iput-boolean p1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mFadingEffect:Z

    .line 53
    monitor-exit v0

    .line 54
    return-void

    .line 53
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public setHeadItemIndex(IF)V
    .locals 4
    .parameter "itemIndex"
    .parameter "speed"

    .prologue
    .line 140
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 142
    :try_start_0
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemOffsetToHead(I)I

    move-result v0

    .line 143
    .local v0, offset:I
    const/4 v2, 0x0

    cmpl-float v2, p2, v2

    if-lez v2, :cond_0

    .line 144
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->reset(Z)V

    .line 145
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v2, v0, p2}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->startMoveAnimation(IF)V

    .line 149
    :goto_0
    monitor-exit v1

    .line 150
    return-void

    .line 148
    :cond_0
    const-string v2, "TFSimpleHolder"

    const-string v3, "Animation speed is set to 0 in setHeadItemIndex"

    invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0

    .line 149
    .end local v0           #offset:I
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method public setHeadItemIndex(II)V
    .locals 4
    .parameter "itemIndex"
    .parameter "duration"

    .prologue
    .line 119
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 120
    :try_start_0
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemOffsetToHead(I)I

    move-result v0

    .line 121
    .local v0, offset:I
    if-lez p2, :cond_0

    .line 122
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->reset(Z)V

    .line 123
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v2, v0, p2}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->startMoveAnimation(II)V

    .line 129
    :goto_0
    monitor-exit v1

    .line 130
    return-void

    .line 126
    :cond_0
    const/4 v2, 0x0

    invoke-virtual {p0, v0, v2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->scrollHeadItemIndex(IZ)I

    .line 127
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->requestLayout()V

    goto :goto_0

    .line 129
    .end local v0           #offset:I
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method public setHeadItemIndex(IZ)V
    .locals 7
    .parameter "itemIndex"
    .parameter "showAnimation"

    .prologue
    .line 82
    const-class v4, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v4

    .line 83
    :try_start_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getHeadItemIndex()I

    move-result v5

    if-gez v5, :cond_1

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v5

    if-eqz v5, :cond_1

    .line 86
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-nez v5, :cond_0

    .line 87
    new-instance v5, Ljava/lang/IllegalArgumentException;

    const-string v6, "Shouldn\'t have reached here."

    invoke-direct {v5, v6}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v5

    .line 108
    :catchall_0
    move-exception v5

    monitor-exit v4
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v5

    .line 89
    :cond_0
    :try_start_1
    iput p1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 90
    const/4 v1, 0x0

    .line 91
    .local v1, idx:I
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v5}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_2

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 92
    .local v2, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    invoke-virtual {p0, v1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->calculateItemIndexOfSlot(I)I

    move-result v5

    invoke-virtual {p0, v2, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 93
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 97
    .end local v0           #i$:Ljava/util/Iterator;
    .end local v1           #idx:I
    .end local v2           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    :cond_1
    invoke-virtual {p0, p1}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemOffsetToHead(I)I

    move-result v3

    .line 98
    .local v3, offset:I
    if-eqz p2, :cond_3

    .line 99
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    const/4 v6, 0x0

    invoke-virtual {v5, v6}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->reset(Z)V

    .line 100
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v5, v3}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->startMoveAnimation(I)V

    .line 108
    .end local v3           #offset:I
    :cond_2
    :goto_1
    monitor-exit v4

    .line 109
    return-void

    .line 104
    .restart local v3       #offset:I
    :cond_3
    const/4 v5, 0x0

    invoke-virtual {p0, v3, v5}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->scrollHeadItemIndex(IZ)I

    .line 105
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->requestLayout()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1
.end method

.method public setOnMoveListener(Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;)V
    .locals 2
    .parameter "onMoveListener"

    .prologue
    .line 671
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 672
    :try_start_0
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnMoveListener:Lcom/nemustech/tiffany/world/TFSimpleHolder$OnMoveListener;

    .line 673
    monitor-exit v0

    .line 674
    return-void

    .line 673
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method protected shiftObjectsMultipleSlots(IZ)I
    .locals 2
    .parameter "offset"
    .parameter "callListener"

    .prologue
    .line 642
    if-lez p1, :cond_2

    .line 643
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-ge v0, p1, :cond_0

    .line 644
    const/4 v1, 0x1

    invoke-virtual {p0, v1, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsSingleSlot(IZ)Z

    move-result v1

    if-nez v1, :cond_1

    .line 660
    :cond_0
    :goto_1
    return v0

    .line 643
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 649
    .end local v0           #i:I
    :cond_2
    if-gez p1, :cond_3

    .line 650
    mul-int/lit8 p1, p1, -0x1

    .line 651
    const/4 v0, 0x0

    .restart local v0       #i:I
    :goto_2
    if-ge v0, p1, :cond_0

    .line 652
    const/4 v1, -0x1

    invoke-virtual {p0, v1, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->shiftObjectsSingleSlot(IZ)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 651
    add-int/lit8 v0, v0, 0x1

    goto :goto_2

    .line 658
    .end local v0           #i:I
    :cond_3
    const/4 v0, 0x0

    .restart local v0       #i:I
    goto :goto_1
.end method

.method protected shiftObjectsSingleSlot(IZ)Z
    .locals 6
    .parameter "direction"
    .parameter "callListener"

    .prologue
    const/4 v5, 0x1

    .line 595
    const/4 v1, 0x0

    .line 596
    .local v1, oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    const/4 v0, 0x0

    .line 597
    .local v0, newItemIndex:I
    const/4 v2, 0x0

    .line 598
    .local v2, shiftSuccess:Z
    if-gez p1, :cond_4

    .line 599
    iget v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    sub-int/2addr v3, v5

    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->adjustItemIndex(I)I

    move-result v0

    .line 601
    iget v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    if-eq v3, v0, :cond_0

    .line 602
    iput v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 603
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v3}, Ljava/util/LinkedList;->removeLast()Ljava/lang/Object;

    move-result-object v1

    .end local v1           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v1, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 604
    .restart local v1       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v3, v1}, Ljava/util/LinkedList;->addFirst(Ljava/lang/Object;)V

    .line 605
    const/4 v3, 0x0

    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->calculateItemIndexOfSlot(I)I

    move-result v3

    invoke-virtual {p0, v1, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 606
    const/4 v2, 0x1

    .line 621
    :cond_0
    :goto_0
    if-eqz p1, :cond_1

    .line 622
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v3

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v4

    if-ge v3, v4, :cond_1

    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWraparound:Z

    if-eqz v3, :cond_1

    .line 623
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->handlePartialEndlessLoop()V

    .line 627
    :cond_1
    if-eqz v2, :cond_3

    .line 628
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectShiftListener:Lcom/nemustech/tiffany/world/TFHolder$OnObjectShiftListener;

    if-eqz v3, :cond_2

    .line 629
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnObjectShiftRunnable:Ljava/lang/Runnable;

    invoke-static {v3}, Lcom/nemustech/tiffany/world/TFWorld;->queueEvent(Ljava/lang/Runnable;)V

    .line 632
    :cond_2
    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDelayedSetItemMode:Z

    if-eqz v3, :cond_3

    .line 633
    iput-boolean v5, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    .line 637
    :cond_3
    return v2

    .line 609
    :cond_4
    if-lez p1, :cond_0

    .line 610
    iget v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->adjustItemIndex(I)I

    move-result v0

    .line 612
    iget v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    if-eq v3, v0, :cond_0

    .line 613
    iput v0, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mHeadItemIndex:I

    .line 614
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v3}, Ljava/util/LinkedList;->removeFirst()Ljava/lang/Object;

    move-result-object v1

    .end local v1           #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    check-cast v1, Lcom/nemustech/tiffany/world/TFObjectContainer;

    .line 615
    .restart local v1       #oc:Lcom/nemustech/tiffany/world/TFObjectContainer;
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mObjectSlots:Ljava/util/LinkedList;

    invoke-virtual {v3, v1}, Ljava/util/LinkedList;->addLast(Ljava/lang/Object;)V

    .line 616
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v3

    sub-int/2addr v3, v5

    invoke-virtual {p0, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->calculateItemIndexOfSlot(I)I

    move-result v3

    invoke-virtual {p0, v1, v3}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->setItemIndexOfObjectInSlot(Lcom/nemustech/tiffany/world/TFObjectContainer;I)V

    .line 617
    const/4 v2, 0x1

    goto :goto_0
.end method

.method public updateLayout(I)Z
    .locals 3
    .parameter "tickPassed"

    .prologue
    .line 550
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 551
    const/4 v0, 0x0

    .line 553
    .local v0, updated:Z
    :try_start_0
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mMoveAni:Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;

    invoke-virtual {v2, p1}, Lcom/nemustech/tiffany/world/TFHolder$MoveAnimation;->update(I)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 554
    const/4 v0, 0x1

    .line 556
    :cond_0
    monitor-exit v1

    return v0

    .line 557
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method protected updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z
    .locals 5
    .parameter "gl"
    .parameter "tickPassed"
    .parameter "bDoGLCalc"

    .prologue
    const/4 v4, 0x0

    .line 494
    invoke-super {p0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFHolder;->updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z

    move-result v0

    .line 495
    .local v0, ret:Z
    const/4 v1, 0x0

    .line 497
    .local v1, updated:Z
    invoke-virtual {p0, p2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->updateLayout(I)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 498
    const/4 v1, 0x1

    .line 501
    :cond_0
    iget-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mRefresh:Z

    if-eqz v2, :cond_1

    .line 504
    iput-boolean v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mRefresh:Z

    .line 505
    const/4 v2, 0x1

    iput-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mLayoutObjects:Z

    .line 506
    const/4 v1, 0x1

    .line 509
    :cond_1
    iget-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDelayedSetItemMode:Z

    if-eqz v2, :cond_2

    iget-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mSetItemNow:Z

    if-eqz v2, :cond_2

    .line 510
    iput-boolean v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mSetItemNow:Z

    .line 511
    iput-boolean v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mNeedToSetItem:Z

    .line 514
    :cond_2
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mImageProvider:Lcom/nemustech/tiffany/world/TFHolder$ImageProvider;

    if-nez v2, :cond_3

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mItemProvider:Lcom/nemustech/tiffany/world/TFItemProvider;

    if-eqz v2, :cond_4

    :cond_3
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getItemCount()I

    move-result v2

    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->getSlotCount()I

    move-result v3

    if-ge v2, v3, :cond_4

    iget-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWraparound:Z

    if-eqz v2, :cond_4

    .line 515
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->handlePartialEndlessLoop()V

    .line 518
    :cond_4
    iget-boolean v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mLayoutObjects:Z

    if-eqz v2, :cond_5

    .line 519
    iget v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mDeviation:F

    invoke-virtual {p0, v2}, Lcom/nemustech/tiffany/world/TFSimpleHolder;->layoutObjects(F)V

    .line 520
    iput-boolean v4, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mLayoutObjects:Z

    .line 521
    const/4 v1, 0x1

    .line 524
    :cond_5
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnUpdateHolderListener:Lcom/nemustech/tiffany/world/TFHolder$OnUpdateHolderListener;

    if-eqz v2, :cond_6

    .line 525
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mOnUpdateHolderListener:Lcom/nemustech/tiffany/world/TFHolder$OnUpdateHolderListener;

    invoke-interface {v2, v1}, Lcom/nemustech/tiffany/world/TFHolder$OnUpdateHolderListener;->onUpdateHolder(Z)V

    .line 527
    :cond_6
    if-eqz v1, :cond_7

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-eqz v2, :cond_7

    .line 528
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFSimpleHolder;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 530
    :cond_7
    return v0
.end method
